#include "PublicHeader.h"
#include "ErrorOutput.h"
#include "OpenUmdfInterfaceTest.h"

using namespace std;

int main() {
    _tsetlocale(LC_ALL, TEXT("chs"));

    _tstring cmd;

	printf("usage: \n");
	printf("n  insert new monitor\n");
	printf("d  depart monitor\n");
	printf("e  echo test\n");
	printf("v  echo version\n");

    while (true) {
        _tcin >> cmd;

        if (cmd == T("e")) {
            if (AdapterEchoTest())
                INFO("Call IOCTL Succeeded!\n");
            else
                INFO("Call IOCTL Failed!\n");
        }
        else if (cmd == T("n")) {
            if (NewMonitorTest())
                INFO("NewMonitorTest Succeeded!\n");
            else
                INFO("NewMonitorTest Failed!\n");
        }
		else if (cmd == T("d")) {
			if (DelMonitorTest())
				INFO("DelMonitorTest Succeeded!\n");
			else
				INFO("DelMonitorTest Failed!\n");
		}
		else if (cmd == T("v"))
		{
			cout << GetVersionTest() << endl;
		}
        else if (cmd == T("q")) {
            break;
        }
    }

    return 0;
}